<template>
    <div class="404">
        <el-empty description="您访问的页面暂时不存在" :image-size="200">
            <el-button
                type="primary"
                @click="$router.replace('/')"
                color="#da9233"
                >返回首页({{ count }}秒)</el-button
            >
        </el-empty>
    </div>
</template>

<script setup>
import { ref, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const count = ref(5)
const timer = setInterval(() => {
    count.value--
    if (count.value == 0) {
        clearInterval(timer)
        router.replace('/')
    }
}, 1000)
onUnmounted(() => {
    clearInterval(timer)
})
</script>

<style lang="scss" scoped></style>
